package gui;

import javax.swing.JPanel;

import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JScrollPane;

public class AppPanelChapterOverview extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3532086094480804100L;
	public static JButton btnNrDown = new JButton("Down");
	public static JLabel lblChapterNr = new JLabel("Move");
	public static JButton btnNrUp = new JButton("Up");
	public static JButton btnChapterCreate = new JButton("Create");
	public static JButton btnChapterDelete = new JButton("Delete");
	public static JButton btnChapterEdit = new JButton("Edit");
	public static JScrollPane scrollPane = new JScrollPane();
	private final JLabel lblListOfChapters = new JLabel("List of Chapters");
	
	/**
	 * Create the panel.
	 */
	public AppPanelChapterOverview() {
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("75px"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		add(lblListOfChapters, "4, 2, 3, 1");
		add(btnChapterEdit, "2, 4");
		
		add(scrollPane, "4, 4, 3, 7, fill, fill");
		add(btnChapterDelete, "2, 6");
		add(btnChapterCreate, "2, 8");
		
		JPanel panelNr = new JPanel();
		add(panelNr, "2, 10, fill, fill");
		panelNr.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		panelNr.add(btnNrUp, "2, 4");
		panelNr.add(lblChapterNr, "2, 6, center, default");
		panelNr.add(btnNrDown, "2, 8");
	}

}
